using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class t_OptionMap : EntityTypeConfiguration<t_Option>
    {
        public t_OptionMap()
        {
            // Primary Key
            this.HasKey(t => new { t.FID, t.FProjectID, t.FOption, t.FFieldName });

            // Properties
            this.Property(t => t.FID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FProjectID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FOption)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.FFieldName)
                .IsRequired()
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("t_Option");
            this.Property(t => t.FID).HasColumnName("FID");
            this.Property(t => t.FProjectID).HasColumnName("FProjectID");
            this.Property(t => t.FOption).HasColumnName("FOption");
            this.Property(t => t.FFieldName).HasColumnName("FFieldName");
        }
    }
}
